#ifndef ITRANSPORT_LAYER_H_INCLUDED
#define ITRANSPORT_LAYER_H_INCLUDED

#include <Core/Box/IBoxCommandIFace.h>

#include <string>
#include <exception>
#include <boost/shared_ptr.hpp>
#include <boost/noncopyable.hpp>

namespace BoxCore {

/**
 * This exception must throw the ITransportLayer and all implmentation of ITransportLayer
 * for detail see ITransportLayer function signatures
 */
class TransportLayerException : public std::exception {
public :
	TransportLayerException(std::string const & what) : m_what(what) { }
	virtual ~TransportLayerException() throw() { }

	virtual char const * what() const throw() { return m_what.c_str(); } 

private :
	std::string const m_what;

};

/**
 *
 */
class ITransportLayer : boost::noncopyable {
public :
	ITransportLayer() { }
	virtual ~ITransportLayer() throw () { }
	
	virtual void performAsync(IBoxCommandIFacePtr commandIFace) throw (TransportLayerException) = 0; 
	virtual void interrupt(bool closeGraceful) throw (TransportLayerException) = 0;
	virtual void wait() throw () = 0;

};

typedef boost::shared_ptr<ITransportLayer> ITransportLayerPtr;

}

#endif

